#ifndef PERSON_H
#define PERSON_H

#include <QObject>
#include<QString>

class Person: public QObject
{
    Q_OBJECT

    // 自定义的属性
    Q_PROPERTY(QString name READ name WRITE setName)
    Q_PROPERTY(int age READ age WRITE setAge)


public:
    explicit Person(QObject * parent = nullptr);

    QString name() const;

    void setName(const QString  & name);

    int age() const;

    void setAge(int age);

signals:
    nameChanged(const QString & name);

    ageChanged(const int &age);


private:
    QString m_name;
    int m_age;

};

#endif // PERSON_H
